package com.frcdi.qms.material.mapper;

import com.frcdi.qms.material.domain.OutboundRecord;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @ClassName OutboundRecordMapper
 * @Author Mr.Han
 * @Description //TODO $
 * @create 2024/7/8 17:36
 **/
// OutboundRecordMapper.java
public interface OutboundRecordMapper {
    @Insert("INSERT INTO outbound_record(material_id, quantity, unit_price, batch_id) VALUES (#{materialId}, #{quantity}, #{unitPrice}, #{batchId})")
    void insert(OutboundRecord record);

    @Select("SELECT * FROM outbound_record WHERE material_id=#{materialId} ORDER BY outbound_date ASC")
    List<OutboundRecord> selectByMaterialId(Integer materialId);
}
